<%@ Page Title="CR_BankCard Item" Language="C#" AutoEventWireup="true" CodeBehind="CR_BankCardItem.aspx.cs" Inherits="Youz.CreditRepay.Manage.CR_BankCardItem" %>
<script>
    //loadCSS("UIResources/Scripts/jquery.validate/valid.css");

    var requireJS = [
        //"assets/js/jquery.form.js"
    ];
    loadJS(requireJS);
</script><div class="row"><div class="col-lg-12"><div class="panel panel-default"><div class="panel-heading"><h2><i class="fa fa-edit"></i><%: R(LanguageModule.CR_BankCard, "CR_BankCard", "CR_BankCard") %></h2></div><div class="panel-body"><form id="frm" class="form-horizontal" method="post" enctype="multipart/form-data" action="Right/Handlers/CR_BankCardHandler.ashx?type=save"><input id="ID" name="ID" type="hidden" />
<div class="form-group">
<label class="control-label" for="Name"><%: R(LanguageModule.CR_BankCard, "Name", "Name") %></label>
<div class="controls"><input type="text" id="Name" name="Name" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="IDNo"><%: R(LanguageModule.CR_BankCard, "IDNo", "IDNo") %></label>
<div class="controls"><input type="text" id="IDNo" name="IDNo" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="CardNo"><%: R(LanguageModule.CR_BankCard, "CardNo", "CardNo") %></label>
<div class="controls"><input type="text" id="CardNo" name="CardNo" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="CVV2"><%: R(LanguageModule.CR_BankCard, "CVV2", "CVV2") %></label>
<div class="controls"><input type="text" id="CVV2" name="CVV2" maxlength="10" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="ExpiryDate"><%: R(LanguageModule.CR_BankCard, "ExpiryDate", "ExpiryDate") %></label>
<div class="controls"><input type="text" id="ExpiryDate" name="ExpiryDate" maxlength="10" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BankName"><%: R(LanguageModule.CR_BankCard, "BankName", "BankName") %></label>
<div class="controls"><input type="text" id="BankName" name="BankName" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BillingDate"><%: R(LanguageModule.CR_BankCard, "BillingDate", "BillingDate") %></label>
<div class="controls"><input type="text" id="BillingDate" name="BillingDate" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RepaymentDate"><%: R(LanguageModule.CR_BankCard, "RepaymentDate", "RepaymentDate") %></label>
<div class="controls"><input type="text" id="RepaymentDate" name="RepaymentDate" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BillingEmail"><%: R(LanguageModule.CR_BankCard, "BillingEmail", "BillingEmail") %></label>
<div class="controls"><input type="text" id="BillingEmail" name="BillingEmail" maxlength="200" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="BankMobile"><%: R(LanguageModule.CR_BankCard, "BankMobile", "BankMobile") %></label>
<div class="controls"><input type="text" id="BankMobile" name="BankMobile" maxlength="20" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="MemberAccount"><%: R(LanguageModule.CR_BankCard, "MemberAccount", "MemberAccount") %></label>
<div class="controls"><input type="text" id="MemberAccount" name="MemberAccount" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RepaymentAmount"><%: R(LanguageModule.CR_BankCard, "RepaymentAmount", "RepaymentAmount") %></label>
<div class="controls"><input type="text" id="RepaymentAmount" name="RepaymentAmount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RepaymentedAmount"><%: R(LanguageModule.CR_BankCard, "RepaymentedAmount", "RepaymentedAmount") %></label>
<div class="controls"><input type="text" id="RepaymentedAmount" name="RepaymentedAmount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="DepositAmount"><%: R(LanguageModule.CR_BankCard, "DepositAmount", "DepositAmount") %></label>
<div class="controls"><input type="text" id="DepositAmount" name="DepositAmount" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="ModifiedOn"><%: R(LanguageModule.CR_BankCard, "ModifiedOn", "ModifiedOn") %></label>
<div class="controls"><input type="text" id="ModifiedOn" name="ModifiedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="alert alert-danger" style="display: none;"><button type="button" class="close" data-dismiss="alert">×</button><strong>Oh snap!</strong><span class="content"></span></div><div class="form-actions"><button class="btn btn-success" type="submit" id="btnSubmit"><%: R(LanguageModule.M_Common, "btnSubmit", "保存修改") %></button>
						<button class="btn btn-default" type="button" id="btnCancel"><%: R(LanguageModule.M_Common, "btnCancel", "取消") %></button></div></form></div></div></div></div><script type="text/javascript">

    var flag = false;

    function validate() {
        return $("#frm").valid();
    };

    function get() {
        $.post("CR/Handlers/CR_BankCardHandler.ashx?type=get", { ID: "<%= WebHelper.Get("ID") %>" }, function (data) {
                $('#frm').fill(data);
            }, 'json');
        }

        $(function () {
            $("#frm").validate({
                errorElement: "span"
            });

            get();

            $("#frm").ajaxForm({
                dataType: 'json',
                beforeSubmit: function (arr, $form, options) {
                    if (flag) {
                        return false;
                    }
                    else {
                        flag = true;
                        return true;
                    }
                },
                success: function (data) {
                    if (data.isSuccess) {
                        loadPage("CR/CR_BankCardList.aspx");
                    }
                    else {
                        $(".alert > .content").html(data.message);
                        $(".alert").show();
                    }
                    flag = false;
                }
            });

            $("#btnCancel").click(function () {
                loadPage("CR/CR_BankCardList.aspx");				
            });
        });

</script>